//
// Created by Tony on 2024/1/14.
//

#ifndef PARSER_AST_LEAF_H
#define PARSER_AST_LEAF_H

#include "Ast.h"

namespace Parser {

class AstLeaf : public Ast {
protected:
    shared_ptr<Lexer::Token> token;

public:
    explicit AstLeaf(const shared_ptr<Lexer::Token>& token) : token(token) {}

    size_t numChildren() override { return 0; }

    vector<shared_ptr<Ast>> getChildren() override { return {}; }

    shared_ptr<Ast> child(int index) override { return nullptr; }

    Lexer::Position position() override { return token->getPosition(); }
};

} // namespace Parser

#endif // PARSER_AST_LEAF_H
